class HomeQueryCourse {
  int pageNum;
  int pageSize;
  PageInfo pageInfo;

  HomeQueryCourse({this.pageNum, this.pageSize, this.pageInfo});

  HomeQueryCourse.fromJson(Map<String, dynamic> json) {
    pageNum = json['pageNum'];
    pageSize = json['pageSize'];
    pageInfo = json['pageInfo'] != null
        ? new PageInfo.fromJson(json['pageInfo'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['pageNum'] = this.pageNum;
    data['pageSize'] = this.pageSize;
    if (this.pageInfo != null) {
      data['pageInfo'] = this.pageInfo.toJson();
    }
    return data;
  }
}

class PageInfo {
  int pageNum;
  int pageSize;
  int size;
  Null orderBy;
  int startRow;
  int endRow;
  int total;
  int pages;
  List<ListData> list;
  int prePage;
  int nextPage;
  bool isFirstPage;
  bool isLastPage;
  bool hasPreviousPage;
  bool hasNextPage;
  int navigatePages;
  List<int> navigatepageNums;
  int navigateFirstPage;
  int navigateLastPage;
  int lastPage;
  int firstPage;

  PageInfo(
      {this.pageNum,
        this.pageSize,
        this.size,
        this.orderBy,
        this.startRow,
        this.endRow,
        this.total,
        this.pages,
        this.list,
        this.prePage,
        this.nextPage,
        this.isFirstPage,
        this.isLastPage,
        this.hasPreviousPage,
        this.hasNextPage,
        this.navigatePages,
        this.navigatepageNums,
        this.navigateFirstPage,
        this.navigateLastPage,
        this.lastPage,
        this.firstPage});

  PageInfo.fromJson(Map<String, dynamic> json) {
    pageNum = json['pageNum'];
    pageSize = json['pageSize'];
    size = json['size'];
    orderBy = json['orderBy'];
    startRow = json['startRow'];
    endRow = json['endRow'];
    total = json['total'];
    pages = json['pages'];
    if (json['list'] != null) {
      // ignore: deprecated_member_use
      list = new List<ListData>();
      json['list'].forEach((v) {
        list.add(new ListData.fromJson(v));
      });
    }
    prePage = json['prePage'];
    nextPage = json['nextPage'];
    isFirstPage = json['isFirstPage'];
    isLastPage = json['isLastPage'];
    hasPreviousPage = json['hasPreviousPage'];
    hasNextPage = json['hasNextPage'];
    navigatePages = json['navigatePages'];
    navigatepageNums = json['navigatepageNums'].cast<int>();
    navigateFirstPage = json['navigateFirstPage'];
    navigateLastPage = json['navigateLastPage'];
    lastPage = json['lastPage'];
    firstPage = json['firstPage'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['pageNum'] = this.pageNum;
    data['pageSize'] = this.pageSize;
    data['size'] = this.size;
    data['orderBy'] = this.orderBy;
    data['startRow'] = this.startRow;
    data['endRow'] = this.endRow;
    data['total'] = this.total;
    data['pages'] = this.pages;
    if (this.list != null) {
      data['list'] = this.list.map((v) => v.toJson()).toList();
    }
    data['prePage'] = this.prePage;
    data['nextPage'] = this.nextPage;
    data['isFirstPage'] = this.isFirstPage;
    data['isLastPage'] = this.isLastPage;
    data['hasPreviousPage'] = this.hasPreviousPage;
    data['hasNextPage'] = this.hasNextPage;
    data['navigatePages'] = this.navigatePages;
    data['navigatepageNums'] = this.navigatepageNums;
    data['navigateFirstPage'] = this.navigateFirstPage;
    data['navigateLastPage'] = this.navigateLastPage;
    data['lastPage'] = this.lastPage;
    data['firstPage'] = this.firstPage;
    return data;
  }
}

class ListData {
  String image;
  String courseClassName;
  Null remark;
  int learningNum;
  Null favouredPrice;
  double price;
  int saleCommodityId;
  FirstProductId firstProductId;
  FirstProductId secondProductId;
  Null promotionPrice;
  Null promotionDate;
  Null classTime;
  Null classStartTime;
  Null classEndTime;
  Null recommendedGrade;
  Null remainingNumber;
  int companyId;
  int classHours;
  Null lessonPackageNum;
  Null surplusLessonNum;
  String lessonChargeFlag;
  String lessonPackageFlag;
  Null surplusLessonNumFlag;
  int totalLessonNum;
  Null lessonPrice;

  ListData(
      {this.image,
        this.courseClassName,
        this.remark,
        this.learningNum,
        this.favouredPrice,
        this.price,
        this.saleCommodityId,
        this.firstProductId,
        this.secondProductId,
        this.promotionPrice,
        this.promotionDate,
        this.classTime,
        this.classStartTime,
        this.classEndTime,
        this.recommendedGrade,
        this.remainingNumber,
        this.companyId,
        this.classHours,
        this.lessonPackageNum,
        this.surplusLessonNum,
        this.lessonChargeFlag,
        this.lessonPackageFlag,
        this.surplusLessonNumFlag,
        this.totalLessonNum,
        this.lessonPrice});

  ListData.fromJson(Map<String, dynamic> json) {
    image = json['image'];
    courseClassName = json['courseClassName'];
    remark = json['remark'];
    learningNum = json['learningNum'];
    favouredPrice = json['favouredPrice'];
    price = json['price'];
    saleCommodityId = json['saleCommodityId'];
    firstProductId = json['firstProductId'] != null
        ? new FirstProductId.fromJson(json['firstProductId'])
        : null;
    secondProductId = json['secondProductId'] != null
        ? new FirstProductId.fromJson(json['secondProductId'])
        : null;
    promotionPrice = json['promotionPrice'];
    promotionDate = json['promotionDate'];
    classTime = json['classTime'];
    classStartTime = json['classStartTime'];
    classEndTime = json['classEndTime'];
    recommendedGrade = json['recommendedGrade'];
    remainingNumber = json['remainingNumber'];
    companyId = json['companyId'];
    classHours = json['classHours'];
    lessonPackageNum = json['lessonPackageNum'];
    surplusLessonNum = json['surplusLessonNum'];
    lessonChargeFlag = json['lessonChargeFlag'];
    lessonPackageFlag = json['lessonPackageFlag'];
    surplusLessonNumFlag = json['surplusLessonNumFlag'];
    totalLessonNum = json['totalLessonNum'];
    lessonPrice = json['lessonPrice'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['image'] = this.image;
    data['courseClassName'] = this.courseClassName;
    data['remark'] = this.remark;
    data['learningNum'] = this.learningNum;
    data['favouredPrice'] = this.favouredPrice;
    data['price'] = this.price;
    data['saleCommodityId'] = this.saleCommodityId;
    if (this.firstProductId != null) {
      data['firstProductId'] = this.firstProductId.toJson();
    }
    if (this.secondProductId != null) {
      data['secondProductId'] = this.secondProductId.toJson();
    }
    data['promotionPrice'] = this.promotionPrice;
    data['promotionDate'] = this.promotionDate;
    data['classTime'] = this.classTime;
    data['classStartTime'] = this.classStartTime;
    data['classEndTime'] = this.classEndTime;
    data['recommendedGrade'] = this.recommendedGrade;
    data['remainingNumber'] = this.remainingNumber;
    data['companyId'] = this.companyId;
    data['classHours'] = this.classHours;
    data['lessonPackageNum'] = this.lessonPackageNum;
    data['surplusLessonNum'] = this.surplusLessonNum;
    data['lessonChargeFlag'] = this.lessonChargeFlag;
    data['lessonPackageFlag'] = this.lessonPackageFlag;
    data['surplusLessonNumFlag'] = this.surplusLessonNumFlag;
    data['totalLessonNum'] = this.totalLessonNum;
    data['lessonPrice'] = this.lessonPrice;
    return data;
  }
}

class FirstProductId {
  int id;
  String name;
  String type;

  FirstProductId({this.id, this.name, this.type});

  FirstProductId.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['type'] = this.type;
    return data;
  }
}

